﻿//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Management.Instrumentation;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability;

namespace EntLibContrib.Resource.Configuration.Manageability
{
	/// <summary>
	/// Represents the configuration information from an unrecognized resource manager instance. 
	/// </summary>
	/// <seealso cref="NamedConfigurationSetting"/>
	/// <seealso cref="ConfigurationSetting"/>
	[ManagementEntity]
	public class UnknownResourceManagerSetting : ResourceManagerBaseSetting
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="UnknownResourceManagerSetting"/> class.
		/// </summary>
		/// <param name="name">The name of the resource manager.</param>
		public UnknownResourceManagerSetting(string name)
			: base(name)
		{ }
		#endregion

		#region Public Static Methods
		/// <summary>
		/// Returns an enumeration of the published <see cref="UnknownResourceManagerSetting"/> instances.
		/// </summary>
		/// <returns></returns>
		[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate"), ManagementEnumerator]
		public static IEnumerable<UnknownResourceManagerSetting> GetInstances()
		{
			return GetInstances<UnknownResourceManagerSetting>();
		}

		/// <summary>
		/// Returns the <see cref="UnknownResourceManagerSetting"/> instance corresponding to the provided values for the key properties.
		/// </summary>
		/// <param name="applicationName">Name of the application.</param>
		/// <param name="sectionName">Name of the section.</param>
		/// <param name="name">The name.</param>
		/// <returns>
		/// The published <see cref="UnknownResourceManagerSetting"/> instance specified by the values for the key properties,
		/// or <see langword="null"/> if no such an instance is currently published.
		/// </returns>
		[ManagementBind]
		public static UnknownResourceManagerSetting BindInstance(string applicationName,
																														string sectionName,
																														string name)
		{
			return BindInstance<UnknownResourceManagerSetting>(applicationName, sectionName, name);
		}
		#endregion
	}
}
